<?php

namespace bc\model\wc;

use bc\ar\MActiveRecord;

class ConfirmModel extends MActiveRecord
{
	
	/**
	 * 定义数据表
	 */
	public static function tableName()
	{
		return '{{%wc_confirm}}';
	}

	/*
	 * 事务通过openid获取用户信息数据
	 * */
	public function getUserInfoFromOpenID($openid)
	{
		$dao = new MActiveRecord();
		$sql = "select a.id as aid,b.id as bid,a.*,b.* from bc_user a ,bc_wc_staff b  where  a.id=b.user_id and a.wxid='{$openid}';";
		$row = $dao->getDb()->createCommand($sql)->queryOne();
		return $row;
	}
}